﻿package jokers.JAdv {
	import jokers.*;
	import jokers.JAdv.*;
	
	public class JChapter8 extends JChapter {
		//初始化章节
		public override function initChapter():void{
			JPara.timer_total = 181;
			JPara.crystalNum = 7;
					
			JTool.initToolBar();
			JTool.setToolEnable(JTool.TOOL_SEARCH);
			JTool.setToolEnable(JTool.TOOL_BOMB);
			
			temp_num_crystal = new Array();
			for(var i:int = 0 ; i < 8 ; i++){
				temp_num_crystal[i] = 0;
			}
		}
		
		//特殊关卡会要求刷新特殊数据
		public override function run():void{
			for(var i:int = 0 ; i < 7 ; i++){
				if(JPara.num_crystal[i] >temp_num_crystal[i]){
					if(i==2)
					  comic_number++;
					else
					  comic_number=0;
				}
				temp_num_crystal[i]=JPara.num_crystal[i] ;
			}
		}
		
		//是否胜利
		public override function isWin():Boolean{
           
			   if(comic_number>=3)
			     return true;
			   else
			    return false;
		}
		
		//文字版提醒
		public override function showTips():String{
			var ret:String = "";
			ret = "连续消除蓝色：" + comic_number + "/3";
			return ret;
		}
		
		var temp_num_crystal=new Array();
		var comic_number=0;
	}
}
